<html xmlns="http://www.w3.org/1999/xhtml"  
    xmlns:h="http://java.sun.com/jsf/html"  
    xmlns:f="http://java.sun.com/jsf/core"  
    xmlns:p="http://primefaces.org/ui">  
    <h:head>
		  <script type="text/javascript">  
		    function handleLoginRequest(xhr, status, args) {  
		        if(args.validationFailed || !args.loggedIn) {  
		            dlg.jq.effect("shake", { times:5 }, 100);  
		        }   
		        else {  
		            dlg.hide();  
		            $('#loginLink').fadeOut();
		            window.location = 'index.xhtml';
		        }  
		    }  
		</script>
		<link href="../css/cotizacionInmobiliaria.css" rel="stylesheet" type="text/css"/>
	</h:head>

<h:body>



<h:form id="frmLogin">  
    
  
    <p:growl id="growl" showDetail="true" life="3000" />  
  
  
  	<table  class="TablaLogin">
     		<tr>
     			<td align="center">
     				<IMG alt="Penta Inmobiliaria" src="../images/logo_penta_2.png" />
     			</td>
     		</tr>
     		<tr>
     			<td align="center">
     				<h:outputLink id="loginLink" value="javascript:void(0)" onclick="dlg.show()" title="login">     
        				<p:graphicImage value="../images/boton_ingresar.png" />  
    				</h:outputLink>  
     			</td>
     		</tr>
        	
      </table>
  
    <p:dialog id="dialog" header="Login" widgetVar="dlg" resizable="false">  
  
        <h:panelGrid columns="2" cellpadding="5">  
            <h:outputLabel for="username" value="Username:" />  
            <p:inputText value="#{loginBean.username}"   
                    id="username" required="true" label="username" />  
              
            <h:outputLabel for="password" value="Password:" />  
            <h:inputSecret value="#{loginBean.password}"   
                    id="password" required="true" label="password" />  
              
            <f:facet name="footer">  
                <p:commandButton id="loginButton" value="Login" update="growl"   
                    actionListener="#{loginBean.login}"   
                    oncomplete="handleLoginRequest(xhr, status, args)"/>  
            </f:facet>  
        </h:panelGrid>  
          
    </p:dialog>  
</h:form>  
	 <p:ajaxStatus style="width:64px;height:64px;position:fixed;right:5px;bottom:5px" id="ajaxStatusPanel">  
    <f:facet name="start">  
        <h:graphicImage value="../images/loading.gif" />  
    </f:facet>  
      
    <f:facet name="complete">  
        <h:outputText value="" />  
    </f:facet>  
	</p:ajaxStatus>
</h:body>
</html> 
  
